﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ClickNET.Imaging;

namespace ClickNET.Web.UI.Controls
{
    public class GalleryImage : Image
    {
        public Picture Picture { get; set; }
        public int ThumbSize { get; set; }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (null != this.Picture)
            {
                this.Src = this.Picture.Url;

                if (this.ThumbSize > 0)
                    this.Src = FileSystemGalleryManager.GetThumbnailUrl(this.Picture, this.ThumbSize);
            }
        }
    }
}
